﻿
//using System.Collections.Generic;
//using VoxelBlock.VoxelBlock3D;
//using VoxelBlock;using Vector3Int = VoxelBlock.Vector3Int;

///// <summary>
///// 笔刷添加或修改
///// </summary>
//public class OperationImplementBrushAddOrPaint : OperationImplement
//{



//    //public OperationImplementBrushAddOrPaint(ProxyOperation proxy) : base(proxy)
//    //{

//    //}

//    public override void Start(StartArg arg)
//    {
//        base.Start(arg);

//    }

//    public override void Run(RunArg arg)
//    {
//        if (arg.updateStartPosition != arg.nowSelectPosition)
//        {
//            var array = BasicAlgorithm.GetLineBlock3D(arg.updateStartPosition, arg.nowSelectPosition);
//            var data = nowDrawVoxel3DCore.DrawAddOrPaintBlock(array, arg.nowSelectUVKey);
//            if (data != null)
//            {
//                historyRecordFrontList.AddRange(data.Item1);
//                historyRecordBreakList.AddRange(data.Item2);
//            }
//        }
//    }

//    public override void Over(OverArg arg)
//    {
//        if (isStop)
//        {
//            if (historyRecordBreakList.Count > 0 || historyRecordFrontList.Count > 0)
//            {
//                historyRecordBreakList = new List<SimpleVoxel>();
//                historyRecordFrontList = new List<SimpleVoxel>();
//            }
//        }
//        else
//        {

//            if (historyRecordBreakList.Count > 0 || historyRecordFrontList.Count > 0)
//            {
//                proxy.Write(VoxelCategories.Operation.AddOrPaint, historyRecordFrontList, historyRecordBreakList);
//                historyRecordBreakList = new List<SimpleVoxel>();
//                historyRecordFrontList = new List<SimpleVoxel>();
//            }
//            else
//            {

//                var data = nowDrawVoxel3DCore.DrawAddOrPaintBlock(new Vector3Int[] { arg.nowSelectPosition }, arg.nowSelectUVKey);
//                historyRecordFrontList = data.Item1;
//                historyRecordBreakList = data.Item2;
//                if (historyRecordBreakList.Count > 0 || historyRecordFrontList.Count > 0)
//                {
//                    proxy.Write(VoxelCategories.Operation.AddOrPaint, historyRecordFrontList, historyRecordBreakList);
//                    historyRecordFrontList = new List<SimpleVoxel>();
//                    historyRecordBreakList = new List<SimpleVoxel>();
//                }
//            }
//        }
//    }

//}
